﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Sql;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

public partial class Modify : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
     }

    protected void confir_Click(object sender, EventArgs e)
    {

        if (TextBox1.Text.Length != 0)
        {
            string conc = ConfigurationManager.ConnectionStrings["ConStr"].ToString();
            SqlConnection cmdc = new SqlConnection(conc);
            try
            {
                cmdc.Open();
                string Mo = "update tb_Department set  Department= " + "'" + TextBox1.Text + "'"+"where ID = "+"'"+Session["UW"]+"'";
                SqlCommand codM = new SqlCommand(Mo, cmdc);
                codM.ExecuteNonQuery();
                cmdc.Close();
            }
            catch (Exception ex)
            {
                cmdc.Close();
            }
        }
        TextBox1.Text = "";
        Response.Redirect("success.aspx");
    }
}